3 PHP Fatal error: Call to undefined method LocalFile::getFileKey() in /usr/local...
authorSam Reed <reedy@users.mediawiki.org>
Wed, 5 Oct 2011 13:47:02 +0000 (13:47 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 5 Oct 2011 13:47:02 +0000 (13:47 +0000)
Tag: REL1_18, 1.18wmf1

includes/api/ApiUpload.php

index d69bc85..961081d 100644 (file)
@@ -175,7 +175,12 @@ class ApiUpload extends ApiBase {
         */
        function performStash() {
                try {
-                       $fileKey = $this->mUpload->stashFile()->getFileKey();
+                       $stashFile = $this->mUpload->stashFile();
+
+                       if ( !$stashFile ) {
+                               throw new MWException( 'Invalid stashed file' );
+                       }
+                       $fileKey = $stashFile->getFileKey();
                } catch ( MWException $e ) {
                        $message = 'Stashing temporary file failed: ' . get_class( $e ) . ' ' . $e->getMessage();
                        wfDebug( __METHOD__ . ' ' . $message . "\n");